NodeFileSeekableSource

class NodeFileSeekableSource(pathStr: String, module: JsAny) : SeekableSource(source)

A Node.js-specific SeekableSource implementation for Kotlin/WasmJs that performs synchronous random access via the Node.js node:fs module (openSync, readSync, fstatSync, closeSync).

This class is intended for Node.js environments (CLI, server, or tests) and is not supported in browser runtimes.

Parameters

pathStr

the filesystem path to the archive file to open in read-only mode.

module

the initialized Emscripten WebAssembly module instance (wasmModule).

Throws

ArchiveIOException

if the file at pathStr cannot be opened.

Constructors

Link copied to clipboard
constructor(pathStr: String, module: JsAny)

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun length(): Long

Returns the total size of the underlying data source in bytes.

Link copied to clipboard
open override fun position(): Long

Returns the current zero-based read offset in bytes from the beginning of the stream.

Link copied to clipboard
open override fun read(buffer: ByteArray, offset: Int, length: Int): Int

Reads up to length bytes from the current position into buffer starting at offset.

Link copied to clipboard
open override fun seek(position: Long)

Sets the absolute byte offset from the beginning of the stream for the next read operation.